Entity Entity
Entity contains functions which control game entities.
It is the parent class of all entity types in Fallout: Tactics. Functions described here are available to be called for any type of entity.
Functions
GetName () | GetName returns the printable name of the entity. |
GetInternalName () | GetInternalName returns the internal name of the entity. |
GetTag () | GetTag returns the TagName value for the entity. |
SetTag (newtag) | SetTag changes the TagName value for the entity. |
GetBaseID () | GetBaseID returns the ID value of the entity from the World entity table. |
GetPosition () | GetPosition returns the position of the entity. |
GetEntitySubType () | GetEntitySubType retrns the subtype of the given entity. |
GetMaxRange (a) | GetMaxRange returns the range of a weapon, if held by the given Actor. |
GetMinEffectiveDamage (a) | GetMinEffectiveDamage returns the minimum damage of a weapon, if held by the given Actor. |
GetMaxEffectiveDamage (a) | GetMaxEffectiveDamage returns the maximum damage of a weapon, if held by the given Actor. |
AddToInventory (e, count) | AddToInventory adds the given entity to this entity's inventory. |
RemoveInventory (e, count) | RemoveInventory removes the given entity from this entity's inventory. |
Destruct () | Destruct removes the entity from the game state. |
SetColor (index, color) | SetColor changes one of the colors associated with the entity. |
RefreshSprite () | RefreshSprite refreshes the sprite associated with the entity. |
CallVtable (index, other_args) | CallVtable calls a function from the current Entity virtual function table (Vtable). |
CallOrigVtable (index, other_args) | CallOrigVtable calls a function from the original Entity virtual function table (Vtable). |
Fields
isEntity | Indicates that the object is an entity. |
ClassType | Contains a string value indicating the type of entity. |
Functions
- GetName ()
-
GetName returns the printable name of the entity.
Returns:
-
A string containing the entity's name.
- GetInternalName ()
-
GetInternalName returns the internal name of the entity. Retrieving this name
is considerably faster than GetName, so it should be used for cases where the
entity name doesn't need to be displayed to the player.
Returns:
-
A string containing the entity's internal name.
- GetTag ()
-
GetTag returns the TagName value for the entity.
Returns:
-
A string containing the entity's TagName.
- SetTag (newtag)
-
SetTag changes the TagName value for the entity.
Parameters:
- newtag A string indicating the new TagName to set.
Returns:
-
None.
- GetBaseID ()
-
GetBaseID returns the ID value of the entity from the World entity table.
NOTE that saving ID values is not advised for any purpose, as they will
change frequently (inventory items change any time they are dropped or equipped,
for example).
Returns:
-
An integer value containing the current value of the entity's ID.
- GetPosition ()
-
GetPosition returns the position of the entity.
Returns:
-
A table containing fields "x", "y", and "z" for the entity's position.
- GetEntitySubType ()
-
GetEntitySubType retrns the subtype of the given entity.
The meaning of the subtype depends on the type of entity. For example,
Actor uses this field as the creature type or race, Armour uses it as the
armour material type, etc.
Returns:
-
A string containing the entity's subtype.
- GetMaxRange (a)
-
GetMaxRange returns the range of a weapon, if held by the given Actor.
This function takes as a parameter an Actor object. The range will be
calculated as if the Actor has equipped this weapon.
While this field is implemented for Entity types, it may only return reasonable
values for Weapon type entities. Return values for other types of entities are
currently unknown.
Parameters:
- a An Actor object to use when determining the weapon's range.
Returns:
-
A numeric value containing the Weapon's maximum range.
- GetMinEffectiveDamage (a)
-
GetMinEffectiveDamage returns the minimum damage of a weapon, if held by the given Actor.
This function takes as a parameter an Actor object. The damage will be
calculated as if the Actor has equipped this weapon.
While this field is implemented for Entity types, it may only return reasonable
values for Weapon type entities. Return values for other types of entities are
currently unknown.
Parameters:
- a An Actor object to use when determining the weapon's minimum damage.
Returns:
-
A numeric value containing the Weapon's minimum damage.
- GetMaxEffectiveDamage (a)
-
GetMaxEffectiveDamage returns the maximum damage of a weapon, if held by the given Actor.
This function takes as a parameter an Actor object. The damage will be
calculated as if the Actor has equipped this weapon.
While this field is implemented for Entity types, it may only return reasonable
values for Weapon type entities. Return values for other types of entities are
currently unknown.
Parameters:
- a An Actor object to use when determining the weapon's maximum damage.
Returns:
-
A numeric value containing the Weapon's maximum damage.
- AddToInventory (e, count)
-
AddToInventory adds the given entity to this entity's inventory.
This function is only implemented for Actor, Container, and Vehicle entity types.
Parameters:
- e The Entity to add to the inventory of this Entity.
- count (optional) How many objects from the Entity to add to inventory (allows partial success).
Returns:
-
If successful, nothing is returned.
Or
- If failed to add to inventory, the first part of the return is the error string returned by AddInventory.
- If failed to add to inventory, the second part of the return is the remainder of the Entity that was not added (in case of partial success).
- RemoveInventory (e, count)
-
RemoveInventory removes the given entity from this entity's inventory.
This function is only implemented for Actor, Container, and Vehicle entity types.
Parameters:
- e The Entity to remove from the the inventory of this Entity.
- count (optional) How many objects to remove from the inventory.
Returns:
-
If successful, returns the Entity that was removed.
Or
-
If failed, returns a string indicating the reason for failure.
- Destruct ()
-
Destruct removes the entity from the game state.
This should be called only on entities which have been removed from an
inventory. If called on a world item, or on an object still in an inventory,
results are unknown.
Returns:
-
None.
- SetColor (index, color)
-
SetColor changes one of the colors associated with the entity.
Note that after the color change, it will be necessary to refresh the sprite
for the entity.
Parameters:
- index The color index to change. Can be one of ENTITY_COLOR_BASE, ENTITY_COLOR_SKIN, ENTITY_COLOR_HAIR, or ENTITY_COLOR_TEAM.
- color A table containing fields "r", "g", "b", "s", and "a", indicating the desired color. Values are floating point between 0 and 1.
Returns:
-
None.
- RefreshSprite ()
-
RefreshSprite refreshes the sprite associated with the entity. This is
necessary after changing the sprite colors.
Returns:
-
None.
- CallVtable (index, other_args)
-
CallVtable calls a function from the current Entity virtual function table (Vtable).
See the "Calling and Hooking Entity Vtable Functions" section for information on how to use Vtable calls, and the Entity vtable list for the functions that can be called, their required parameters, and return values.Parameters:
- index The vtable function number to call
- other_args Zero or more arguments, depending on the needed parameters of the specified vtable function. The needed parameters and their meaning are described for each (known) vtable entry.
Returns:
-
Varies depending on the function called.
See also:
- CallOrigVtable (index, other_args)
-
CallOrigVtable calls a function from the original Entity virtual function table (Vtable). This will generally be used to call the original vtable code from a vtable hook.
See the "Calling and Hooking Entity Vtable Functions" section for information on how to use Vtable calls, and the Entity vtable list for the functions that can be called, their required parameters, and return values.
Parameters:
- index The vtable function number to call
- other_args Zero or more arguments, depending on the needed parameters of the specified vtable function. The needed parameters and their meaning are described for each (known) vtable entry.
Returns:
-
Varies depending on the function called.
See also: